<div class="page-body">
    <div class="row">
        <div class="widget">
            <div class="widget-body">
                <div id="horizontal-form">
                    <form class="form-horizontal" role="form" action="{:U('store')}"
                          method="post" enctype="multipart/form-data">
                        <input type="hidden" name="product_id" value="{$data.product_id}">
                        <div class="form-group">
                            <label for="sm" class="col-sm-3 control-label no-padding-right">商品名：</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" name="name" value="{$data.name}" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">定价：</label>
                            <div class="col-sm-3">
                                <input type="number" name="price" class="form-control" value="{$data.price}" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">库存：</label>
                            <div class="col-sm-3">
                                <input type="number" name="stock" class="form-control" value="{$data.stock}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">封面：</label>
                            <div class="col-sm-3">
                                <input type="file" name="b_logo">
                                <notempty name="data.logo">
                                    <img src="{$data.logo}" height="100">
                                </notempty>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">图文详情：</label>
                            <div class="col-sm-9"><script id="editor" type="text/plain" style="width:100%;min-height:500px;">{$data.detail}</script></div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-10">
                                <button type="submit" class="btn btn-primary">提 交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript" charset="utf-8" src="/admin/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/admin/js/ueditor/ueditor.all.min.js"></script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="/admin/js/ueditor/lang/zh-cn/zh-cn.js"></script>
<script>
    $(document).ready(function () {
        //实例化编辑器
        //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
        var ue = UE.getEditor('editor');
    });
</script>